Page({
	yijian(e){
		console.log('数据', e)
		let xingming = e.detail.value.xingming
		let shouji = e.detail.value.shouji
		let yijian=e.detail.value.yijian
		if (xingming == "") {
			wx.showToast({
				icon: "none",
				title: '姓名为空',
			})
			return
		}
		if (shouji == "") {
			wx.showToast({
				icon: "none",
				title: '手机为空',
			})
			return
		}
		if (yijian == "") {
			wx.showToast({
				icon: "none",
				title: '意见为空',
			})
			return
		}
		wx.cloud.database().collection('advice')
		.add({
			data: {
				xingming: xingming,
				shouji: shouji,
			  yijian:yijian
			}
		})
		.then(res => {
			wx.showToast({
				title: '感谢反馈',
			})
		})
		.catch(res => {
			wx.showToast({
				icon: 'error',
				title: '提交失败',
			})
		})
	}
})